/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.emp.solbrillante.sales.view;

import java.util.ArrayList;
import pe.emp.solbrillante.sale.Main;
import pe.emp.solbrillante.sales.bean.Producto;
import pe.emp.solbrillante.sales.bean.Usuarios;

/**
 *
 * @author TacbaranNew
 */
public class VentanaPrincipalLogin extends javax.swing.JFrame {

    /**
     * Creates new form VentanaPrincipalLogin
     */
    public VentanaPrincipalLogin() {
        initComponents();
        
        //pintamos el fondo de la ventana
        ((JFondo)jfondo).setImagen("fondo_01.jpg");
        //pintamos la barra lateral
        ((JFondo)jlateral).setImagen("barraLateral-201x705.png");
        //pintamos los paneles que van funcionar como botones
        ((JFondo)jProveedor).setImagen("boton-180x49.png");
        
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10+70 *0);
        
        ((JFondo)jCliente).setImagen("boton-180x49.png");
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10 +70*1);
        
        ((JFondo)jVentas).setImagen("boton-180x49.png");
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10 +70 *2);
        ((JFondo)jPedidos).setImagen("boton-180x49.png");
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10+70 *3);
        ((JFondo)jAlmacen).setImagen("boton-180x49.png");
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10+70 *4);
        ((JFondo)jProducto).setImagen("boton-180x49.png");
        jProveedor.setLocation(jlateral.getX()+150, jlateral.getY()+10+70 *5);
     
        //mostramos los ocultamos
        MostarBotones(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jfondo = new JFondo();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtUsuario = new javax.swing.JTextField();
        btnInicio = new javax.swing.JButton();
        txtContraseña = new javax.swing.JPasswordField();
        jlateral = new JFondo();
        jProveedor = new JFondo();
        jLabel3 = new javax.swing.JLabel();
        jCliente = new JFondo();
        jLabel4 = new javax.swing.JLabel();
        jVentas = new JFondo();
        jLabel5 = new javax.swing.JLabel();
        jPedidos = new JFondo();
        jLabel6 = new javax.swing.JLabel();
        jAlmacen = new JFondo();
        jLabel7 = new javax.swing.JLabel();
        jProducto = new JFondo();
        jLabel8 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema Sol Brillante");
        setMaximumSize(new java.awt.Dimension(1200, 900));
        setMinimumSize(new java.awt.Dimension(1050, 750));
        setPreferredSize(new java.awt.Dimension(1050, 750));

        jfondo.setMaximumSize(new java.awt.Dimension(1200, 900));
        jfondo.setMinimumSize(new java.awt.Dimension(1000, 700));
        jfondo.setPreferredSize(new java.awt.Dimension(1000, 700));

        jLabel1.setText("Usuario");

        jLabel2.setText("Contraseña");

        btnInicio.setText("Iniciar sesión");
        btnInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInicioActionPerformed(evt);
            }
        });

        jlateral.setBackground(new java.awt.Color(255, 255, 255));
        jlateral.setMaximumSize(new java.awt.Dimension(201, 700));
        jlateral.setMinimumSize(new java.awt.Dimension(201, 700));
        jlateral.setPreferredSize(new java.awt.Dimension(201, 700));

        jProveedor.setBackground(new java.awt.Color(204, 255, 255));
        jProveedor.setMaximumSize(new java.awt.Dimension(180, 49));
        jProveedor.setMinimumSize(new java.awt.Dimension(180, 49));
        jProveedor.setPreferredSize(new java.awt.Dimension(180, 49));
        jProveedor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jProveedorMouseClicked(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel3.setText("Proveedor");

        javax.swing.GroupLayout jProveedorLayout = new javax.swing.GroupLayout(jProveedor);
        jProveedor.setLayout(jProveedorLayout);
        jProveedorLayout.setHorizontalGroup(
            jProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jProveedorLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jProveedorLayout.setVerticalGroup(
            jProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jProveedorLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel3)
                .addContainerGap())
        );

        jCliente.setBackground(new java.awt.Color(204, 255, 255));
        jCliente.setMaximumSize(new java.awt.Dimension(180, 49));
        jCliente.setMinimumSize(new java.awt.Dimension(180, 49));
        jCliente.setPreferredSize(new java.awt.Dimension(180, 49));
        jCliente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jClienteMouseClicked(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel4.setText("Cliente");

        javax.swing.GroupLayout jClienteLayout = new javax.swing.GroupLayout(jCliente);
        jCliente.setLayout(jClienteLayout);
        jClienteLayout.setHorizontalGroup(
            jClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClienteLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jClienteLayout.setVerticalGroup(
            jClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClienteLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel4)
                .addContainerGap())
        );

        jVentas.setBackground(new java.awt.Color(204, 255, 255));
        jVentas.setMaximumSize(new java.awt.Dimension(180, 49));
        jVentas.setMinimumSize(new java.awt.Dimension(180, 49));
        jVentas.setPreferredSize(new java.awt.Dimension(180, 49));
        jVentas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jVentasMouseClicked(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel5.setText("Ventas");

        javax.swing.GroupLayout jVentasLayout = new javax.swing.GroupLayout(jVentas);
        jVentas.setLayout(jVentasLayout);
        jVentasLayout.setHorizontalGroup(
            jVentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jVentasLayout.createSequentialGroup()
                .addContainerGap(96, Short.MAX_VALUE)
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jVentasLayout.setVerticalGroup(
            jVentasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jVentasLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel5)
                .addContainerGap())
        );

        jPedidos.setBackground(new java.awt.Color(204, 255, 255));
        jPedidos.setMaximumSize(new java.awt.Dimension(180, 49));
        jPedidos.setMinimumSize(new java.awt.Dimension(180, 49));
        jPedidos.setPreferredSize(new java.awt.Dimension(180, 49));
        jPedidos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jPedidosMouseClicked(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel6.setText("Pedidos");

        javax.swing.GroupLayout jPedidosLayout = new javax.swing.GroupLayout(jPedidos);
        jPedidos.setLayout(jPedidosLayout);
        jPedidosLayout.setHorizontalGroup(
            jPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPedidosLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPedidosLayout.setVerticalGroup(
            jPedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPedidosLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel6)
                .addContainerGap())
        );

        jAlmacen.setBackground(new java.awt.Color(204, 255, 255));
        jAlmacen.setMaximumSize(new java.awt.Dimension(180, 49));
        jAlmacen.setMinimumSize(new java.awt.Dimension(180, 49));
        jAlmacen.setPreferredSize(new java.awt.Dimension(180, 49));
        jAlmacen.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jAlmacenMouseClicked(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel7.setText("Almacen");

        javax.swing.GroupLayout jAlmacenLayout = new javax.swing.GroupLayout(jAlmacen);
        jAlmacen.setLayout(jAlmacenLayout);
        jAlmacenLayout.setHorizontalGroup(
            jAlmacenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jAlmacenLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jAlmacenLayout.setVerticalGroup(
            jAlmacenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jAlmacenLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel7)
                .addContainerGap())
        );

        jProducto.setBackground(new java.awt.Color(204, 255, 255));
        jProducto.setMaximumSize(new java.awt.Dimension(180, 49));
        jProducto.setMinimumSize(new java.awt.Dimension(180, 49));
        jProducto.setPreferredSize(new java.awt.Dimension(180, 49));
        jProducto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jProductoMouseClicked(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel8.setText("Producto");

        javax.swing.GroupLayout jProductoLayout = new javax.swing.GroupLayout(jProducto);
        jProducto.setLayout(jProductoLayout);
        jProductoLayout.setHorizontalGroup(
            jProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jProductoLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jProductoLayout.setVerticalGroup(
            jProductoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jProductoLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel8)
                .addContainerGap())
        );

        javax.swing.GroupLayout jlateralLayout = new javax.swing.GroupLayout(jlateral);
        jlateral.setLayout(jlateralLayout);
        jlateralLayout.setHorizontalGroup(
            jlateralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jlateralLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jlateralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jVentas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(11, Short.MAX_VALUE))
        );
        jlateralLayout.setVerticalGroup(
            jlateralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jlateralLayout.createSequentialGroup()
                .addGap(43, 43, 43)
                .addComponent(jProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jVentas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPedidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(322, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jfondoLayout = new javax.swing.GroupLayout(jfondo);
        jfondo.setLayout(jfondoLayout);
        jfondoLayout.setHorizontalGroup(
            jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jfondoLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jlateral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(333, 487, Short.MAX_VALUE)
                .addGroup(jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnInicio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
                    .addComponent(txtUsuario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
                    .addComponent(txtContraseña, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(59, 59, 59))
        );
        jfondoLayout.setVerticalGroup(
            jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jfondoLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGroup(jfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtContraseña, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnInicio)
                .addGap(31, 31, 31))
            .addComponent(jlateral, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 742, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jfondo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jfondo, javax.swing.GroupLayout.DEFAULT_SIZE, 742, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInicioActionPerformed
        // TODO add your handling code here:
        
        
        //nos conectamos a nuestro servicio
         ArrayList<Usuarios> usuarios = Main.myService.queryAllUsuarios();
         
         //convertimos la contraseña
         String contraseña=  new String (txtContraseña.getPassword());
         
        //recorremos el arreglo       
        for(int i=0; i<usuarios.size(); i++){

            
            
            
           //verificamos si existe usario
            if( usuarios.get(i).getNombre().equalsIgnoreCase(txtUsuario.getText()) &&  usuarios.get(i).getContraseña().equalsIgnoreCase( contraseña    ) )
            {
                // pintamos la nueva escena
                ((JFondo)jfondo).setImagen("Fondo_Parte_II-1000x700.jpg");
                //ocultamos elementos        
                OcultarElementos();
                //mostramos los Botones
                MostarBotones(true);
            
            }

        
        
        }
        

        
        
    }//GEN-LAST:event_btnInicioActionPerformed

    private void jProveedorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jProveedorMouseClicked
        // TODO add your handling code here:
                    JProveedor jproveedor;
                   jproveedor = new JProveedor(new VentanaPrincipalLogin(), true);
                   jproveedor.setLocation(this.getLocation().x+245,this.getLocation().y+100);
                   jproveedor.setVisible(true); 
        
    }//GEN-LAST:event_jProveedorMouseClicked

    private void jClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jClienteMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jClienteMouseClicked

    private void jVentasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jVentasMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jVentasMouseClicked

    private void jPedidosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPedidosMouseClicked
        // TODO add your handling code here:
                   JPedido jpedido;
                   jpedido = new JPedido(new VentanaPrincipalLogin(), true);
                   jpedido.setLocation(this.getLocation().x+245,this.getLocation().y+100);
                   jpedido.setVisible(true);
    }//GEN-LAST:event_jPedidosMouseClicked

    private void jAlmacenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jAlmacenMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jAlmacenMouseClicked

    private void jProductoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jProductoMouseClicked
        // TODO add your handling code here:
       JProducto jproducto;
        jproducto = new JProducto(new VentanaPrincipalLogin(), true);
        jproducto.setLocation(this.getLocation().x+245,this.getLocation().y+100);
        jproducto.setVisible(true);
    }//GEN-LAST:event_jProductoMouseClicked

    private void OcultarElementos(){
        txtContraseña.setVisible(false);
        txtUsuario.setVisible(false);
        jLabel1.setVisible(false);
        jLabel2.setVisible(false);
        btnInicio.setVisible(false);
    }
    private void MostarBotones(Boolean bol){
        jlateral.setVisible(bol);
        jProveedor.setVisible(bol);
        jCliente.setVisible(bol);
        jVentas.setVisible(bol);
        jPedidos.setVisible(bol);
        jAlmacen.setVisible(bol);
        jProducto.setVisible(bol);

    } 
  
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipalLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipalLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipalLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipalLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentanaPrincipalLogin().setVisible(true);
                
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnInicio;
    private javax.swing.JPanel jAlmacen;
    private javax.swing.JPanel jCliente;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPedidos;
    private javax.swing.JPanel jProducto;
    private javax.swing.JPanel jProveedor;
    private javax.swing.JPanel jVentas;
    private javax.swing.JPanel jfondo;
    private javax.swing.JPanel jlateral;
    private javax.swing.JPasswordField txtContraseña;
    private javax.swing.JTextField txtUsuario;
    // End of variables declaration//GEN-END:variables
}
